﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iOak.Common.Untity;

namespace iOak.Common
{
    public class ResourceHelper
    {
        /// <summary>
        /// 获取候选人状态名称
        /// </summary>
        /// <returns>状态名称</returns>
        public static String GetCandidateStatusName(bool? passed) 
        {
            String statusName = String.Empty;
            if (!passed.HasValue) 
            {
                statusName = "未审核";
            }
            else if (passed.Value)
            {
                statusName = "通过";
            }
            else
            {
                statusName = "未通过";
            }
            return statusName;
        }

        /// <summary>
        /// 获取状态名称
        /// </summary>
        /// <param name="campaignStatus"></param>
        /// <returns>状态名称</returns>
        public static String GetCampaignStatusName(int campaignStatus)
        {
            var statusName = String.Empty;
            switch (campaignStatus)
            {
                case (int)CampaignStatus.Open:
                    statusName = "新建";
                    break;
                case (int)CampaignStatus.Appling:
                    statusName = "执行中";
                    break;
                //case (int)CampaignStatus.Checking:
                //    statusName = "审核中";
                //    break;
                case (int)CampaignStatus.Closed:
                    statusName = "结束";
                    break;
            }
            return statusName;
        }

        /// <summary>
        /// 获取状态名称
        /// </summary>
        /// <param name="campaignStatus"></param>
        /// <returns>状态名称</returns>
        public static String GetApplicationStatusName(int applicationStatus)
        {
            var statusName = String.Empty;
            switch (applicationStatus)
            {
                case (int)ApplicationStatus.Open:
                    statusName = "未申报";
                    break;
                case (int)ApplicationStatus.Submitted:
                    statusName = "已申报";
                    break;
                //case (int)ApplicationStatus.Checking:
                //    statusName = "审核中";
                //    break;
                case (int)ApplicationStatus.Checked:
                    statusName = "已审核";
                    break;
            }
            return statusName;
        }
    }
}
